<?php

namespace app\api\model;

class VipOrder extends Common
{
    static public function index($user_id, $id, $money, $method, $type=0)
    {
        $order_sn = uniqid();

        $data = [
            "vip_order" => $order_sn,
            "sid" => $id,
            "user_id" => $user_id,
            "pay" => $method,
            "price" => $money,
            "type" => $type,
            "status" => 1,
        ];

        $order = self::create($data);

        return ['id' => $order->id, 'order_sn' => $order_sn];
    }
}
